from django.contrib import admin
from django.core.cache import cache
from apps.user.models import *
# Register your models here.
class BaseModelAdmin(admin.ModelAdmin):

    def save_model(self, request, obj, form, change):
        super().save_model(request,obj,form,change)
        # cache.delete('index_page_data')

    def delete_model(self, request, obj):
        super().delete_model(request,obj)

        # cache.delete('index_page_data')
class AllGoodsCategoryAdmin(BaseModelAdmin):
    pass
class IndexNewsInformationTypeAdmin(BaseModelAdmin):
    pass
class IndexNewsInfomationsAdmin(BaseModelAdmin):
    pass
class GoodsTypeAdmin(BaseModelAdmin):
    pass
class IndexTypeGoodsBannerAamin(BaseModelAdmin):
    pass
class GoodsSpuAdmin(BaseModelAdmin):
    pass
class GoodsSkuAdmin(BaseModelAdmin):
    pass
class IndexGoodsBannerAdmin(BaseModelAdmin):
    pass
class IndexPromotionBannerAdmin(BaseModelAdmin):
    pass
class IndexLimitedTimeSaleFormAdmin(BaseModelAdmin):
    pass
class GoodsImagesAdmin(BaseModelAdmin):
    pass
class GoodsBrandInfoAdmin(BaseModelAdmin):
    pass
class GoodsSpecificationsAdmin(BaseModelAdmin):
    pass
class GoodsSpecificationsValueAdmin(BaseModelAdmin):
    pass
class GoodsSpecificationsSkuAndValueAdmin(BaseModelAdmin):
    pass
class GoodsSpecificationsAndSpuAdmin(BaseModelAdmin):
    pass
class IndexGoodsTypeActivityImageAdmin(BaseModelAdmin):
    pass



admin.site.register(GoodsCategory,AllGoodsCategoryAdmin)
admin.site.register(GoodsSku,GoodsSkuAdmin)
admin.site.register(GoodsSpu,GoodsSpuAdmin)
admin.site.register(IndexNewsInfomations,IndexNewsInfomationsAdmin)
admin.site.register(GoodsType,GoodsTypeAdmin)
admin.site.register(IndexNewsInformationType,IndexNewsInformationTypeAdmin)
admin.site.register(IndexTypeGoodsBanner,IndexTypeGoodsBannerAamin)
admin.site.register(IndexPromotionBanner,IndexPromotionBannerAdmin)
admin.site.register(IndexGoodsBanner,IndexGoodsBannerAdmin)
admin.site.register(IndexLimitedTimeSaleForm,IndexLimitedTimeSaleFormAdmin)
admin.site.register(GoodsImages,GoodsImagesAdmin)
admin.site.register(GoodsBrandInfo,GoodsBrandInfoAdmin)
admin.site.register(GoodsSpecifications,GoodsSpecificationsAdmin)
admin.site.register(GoodsSpecificationsValue,GoodsSpecificationsValueAdmin)
admin.site.register(GoodsSpecificationsSkuAndValue,GoodsSpecificationsSkuAndValueAdmin)
admin.site.register(GoodsSpecificationsAndSpu,GoodsSpecificationsAndSpuAdmin)
admin.site.register(IndexGoodsTypeActivityImage,IndexGoodsTypeActivityImageAdmin)
